<!--查询商品-->
<h3>根据条件进行相应的商品查询</h3>
<div id="product_search">

<!--错误信息-->
<p class="error" id="error_info">
<?php echo @$res['info']; ?>
</p>

<div id="tabs">
<ul>
	<li><a href="#tabs-1">按商品搜索</a></li>
	<li><a href="#tabs-2">按模板搜索</a></li>
</ul>

<div id="tabs-1">
<form action="/admin/product/do_search_product_at_spec_class" method="post" id="product_at_spec_class_search_form">
	 <div class="span-8 cell">
		 <p>
		 <h3>商品发布的时间段</h3>
		 <label for="product_time_from">从</label>
		 <input id="product_at_spec_class_time_from" type="text" name="product_time_from" class="text from"/><br />
		 <label for="product_time_to">到</label>
		 <input id="product_at_spec_class_time_to" type="text" name="product_time_to" class="text to"/>
		 </p>
	 </div>
	 <div class="span-8 cell">
		 <p>
		 <h3>商品相关关键字</h3>
		 <p>
		 <label for="prodct_cond"></label>
		 <select id="" name="product_cond">
		 	<option value="product_id">编号</option>
		 	<option value="title">标题</option>
		 	<option value="describe">内容</option>
		 </select>
		 <input type="text" class="text" name="product_cond_value" id="product_cond_value" />
		 <hr />
		 <p>
		 <h3>商品单价范围</h3>
		 <label for="product_price_from">从</label>
		 <input type="text" name="product_price_from" class="text"/><br />
		 <label for="product_price_to">到</label>
		 <input type="text" name="product_price_to" class="text"/>
		 </p>
		 </p>
	 </div>
         <div class="span-8 cell">
		<p>
		<h3>服务相关关键字</h3>
		<label for="product_class_cond"></label>
		<select id="product_class_cond" name="product_class_cond">
		        <option value="product_class_name_cn">服务名称</option>
		</select>
 	 	<input type="text" class="text" name="product_class_cond_value"/> 
                </p>
	 </div>
	 <p>
	 	 <span id="product_at_spec_class_search_form_submit_button">查询</span>
	 </p>
	 </form>
</div>

<div id="tabs-2">
<form action="/admin/product/do_search_product" method="post" id="product_search_form">
	 <div class="span-8 cell">
		 <p>
		 <h3>商品发布的时间段</h3>
		 <label for="product_time_from">从</label>
		 <input type="text" id="product_time_from" name="product_time_from" class="text from"/><br />
		 <label for="product_time_to">到</label>
		 <input type="text" id="product_time_to" name="product_time_to" class="text to"/>
		 </p>
	 </div>
	 <div class="span-8 cell">
		 <p>
		 <h3>商品相关关键字</h3>
		 <p>
		 <label for="prodct_cond"></label>
		 <select id="" name="product_cond">
		 	<option value="product_id">编号</option>
		 	<option value="title">标题</option>
		 	<option value="describe">内容</option>
		 </select>
		 <input type="text" class="text" name="product_cond_value"/>
		 <hr />
		 <p>
		 <h3>商品单价范围</h3>
		 <label for="product_price_from">从</label>
		 <input type="text" name="product_price_from" class="text"/><br />
		 <label for="product_price_to">到</label>
		 <input type="text" name="product_price_to" class="text"/>
		 </p>
		 </p>
	 </div>
	 <p>
	 	 <span id="product_search_form_submit_button">查询</span>
	 </p>
	 </form>
</div>
</div>

</div>
<script type="text/javascript">
$(function(){
        $( "#tabs" ).tabs();
        $( '#tabs' ).find( 'ul' ).removeClass( 'ui-widget-header' );
	var dates = $( "#product_time_from, #product_time_to" ).datepicker({
		altFormat: 'yy-mm-dd',
		defaultDate: "+1w",
		changeMonth: true,
		numberOfMonths: 1,
		onSelect: function( selectedDate ) {
			var option = this.id == "product_time_from" ? "minDate" : "maxDate",
				instance = $( this ).data( "datepicker" ),
				date = $.datepicker.parseDate(
					instance.settings.dateFormat ||
					$.datepicker._defaults.dateFormat,
					selectedDate, instance.settings );
			dates.not( this ).datepicker( "option", option, date );
		}
        });
        var dates = $( "#product_at_spec_class_time_from, #product_at_spec_class_time_to" ).datepicker({
		altFormat: 'yy-mm-dd',
		defaultDate: "+1w",
		changeMonth: true,
		numberOfMonths: 1,
		onSelect: function( selectedDate ) {
			var option = this.id == "product_at_spec_class_time_from" ? "minDate" : "maxDate",
				instance = $( this ).data( "datepicker" ),
				date = $.datepicker.parseDate(
					instance.settings.dateFormat ||
					$.datepicker._defaults.dateFormat,
					selectedDate, instance.settings );
			dates.not( this ).datepicker( "option", option, date );
		}
	});
	//使能搜索按钮
	$( '#product_search_form_submit_button' ).button();
	$( '#product_search_form_submit_button').click( function(){
		 $( '#product_search_form' ).submit();
        });
        $( '#product_at_spec_class_search_form_submit_button' ).button();
	$( '#product_at_spec_class_search_form_submit_button').click( function(){
		 $( '#product_at_spec_class_search_form' ).submit();
        });
});
</script>
